/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package it.polimi.registration.gui.security;

import it.polimi.registration.business.security.boundary.BadWeatherManager;
import it.polimi.registration.business.security.boundary.EventManager;
import it.polimi.registration.business.security.boundary.UsersManager;
import it.polimi.registration.business.security.entity.BadWeatherNotification;
import it.polimi.registration.business.security.entity.Event;
import java.util.List;
import javax.annotation.PostConstruct;
import javax.ejb.EJB;
import javax.enterprise.context.RequestScoped;
import javax.faces.bean.ManagedBean;

/**
 *
 * @author Luca
 */
@ManagedBean
@RequestScoped
public class BadCarouselView {
    
    private List<Event> notifications;
    
    private Event selectedNotification;
    @EJB
    private BadWeatherManager bwm;
    @EJB
    private UsersManager um;
    
    
    @PostConstruct
    public void init() {
        notifications = bwm.loadNotifications(um.getLoggedUsers());
    }
    
    public void loadNotifications() {
        notifications = bwm.loadNotifications(um.getLoggedUsers());
    }

    /**
     * @return the notifications
     */
    public List<Event> getNotifications() {
        return notifications;
    }

    /**
     * @param notifications the notifications to set
     */
    public void setNotifications(List<Event> notifications) {
        this.notifications = notifications;
    }
}
